import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/home/Home.vue')
  },
  {
    path: '/category/:categoryId',
    name: 'CategoryGoods',
    component: () => import('@/views/goods/CategoryGoods.vue')
  },
  {
    path: '/goods/:goodsId',
    name: 'GoodsDetail',
    component: () => import('@/views/goods/GoodsDetail.vue')
  },
  {
    path: '/announcement',
    name: 'AnnouncementList',
    component: () => import('@/views/announcement/AnnouncementList.vue')
  },
  {
    path: '/announcement/:announcementId',
    name: 'AnnouncementDetail',
    component: () => import('@/views/announcement/AnnouncementDetail.vue')
  },
  {
    path: '/profile',
    name: 'Profile',
    component: () => import('@/views/user/Profile.vue')
  },
  {
    path: '/cart',
    name: 'Cart',
    component: () => import('@/views/cart/CartList.vue')
  },
  {
    path: '/coupon-center',
    name: 'CouponCenter',
    component: () => import('@/views/coupon/CouponCenter.vue')
  },
  {
    path: '/my-coupons',
    name: 'MyCoupons',
    component: () => import('@/views/coupon/MyCoupons.vue')
  },
  {
    path: '/my-orders',
    name: 'MyOrders',
    component: () => import('@/views/order/OrderList.vue')
  },
  {
    path: '/order-confirm',
    name: 'OrderConfirm',
    component: () => import('@/views/order/OrderConfirm.vue')
  },
  {
    path: '/my-collects',
    name: 'MyCollects',
    component: () => import('@/views/collect/MyCollects.vue')
  },
  {
    path: '/search',
    name: 'SearchResult',
    component: () => import('@/views/search/SearchResult.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
